//
//  HJDTitleLabel.m
//  常州红房子
//
//  Created by 胡金东 on 16/7/23.
//  Copyright © 2016年 胡金东. All rights reserved.
//

#import "HJDTitleLabel.h"
#import "BSMacros.h"
#define XMGRed 0.74
#define XMGGreen 0.74
#define XMGBlue 0.74


#define XMGRed1 0.98
#define XMGGreen1 0.98
#define XMGBlue1 0.98

@implementation HJDTitleLabel


- (instancetype)initWithFrame:(CGRect)frame
{
    
    if (self = [super initWithFrame:frame]) {
//        CGFloat viewX = IS_IPHONE_5?0:IS_IPHONE_6?0:IS_IPHONE_6_PLUS?0:0;
//        CGFloat viewW = IS_IPHONE_5?54:IS_IPHONE_6?68:IS_IPHONE_6_PLUS?70:50;
        self.view = [[UIView alloc]initWithFrame:CGRectMake(15, 41, 70, 2)];
        self.view.backgroundColor = [UIColor colorWithRed:XMGRed1 green:XMGGreen1 blue:XMGBlue1 alpha:0];
//
        [self addSubview:self.view];
//        NSLog(@"%@",self.view);

        self.font = [UIFont systemFontOfSize:19];
        
        self.textColor = [UIColor colorWithRed:0.74 green:0.74 blue:0.74 alpha:1.0];

        self.textAlignment = NSTextAlignmentCenter;
        self.backgroundColor = [UIColor clearColor];
        self.userInteractionEnabled = YES;
       
        

    }

    return self;
}

- (void)setScale:(CGFloat)scale
{
    _scale = scale;
    
    //      R G B
    // 默认：0.4 0.6 0.7
    // 红色：1   0   0
    
    CGFloat red = XMGRed + (1 - XMGRed) * scale;
    CGFloat green = XMGGreen + (0.57 - XMGGreen) * scale;
    CGFloat blue = XMGBlue + (0.64 - XMGBlue) * scale;
    self.textColor = [UIColor colorWithRed:red green:green blue:blue alpha:1.0];
    CGFloat red1 = XMGRed1 + (1 - XMGRed1) * scale;
    CGFloat green1 = XMGGreen1 + (0.57 - XMGGreen1) * scale;
    CGFloat blue1 = XMGBlue1 + (0.64 - XMGBlue1) * scale;

    self.view.backgroundColor = [UIColor colorWithRed:red1 green:green1 blue:blue1 alpha:1.0];

    
    // 大小缩放比例
    CGFloat transformScale = 1 + scale * 0.3 ;
    self.transform = CGAffineTransformMakeScale(transformScale, transformScale);
}

@end
